Binding Object


Binding Object is a way how to easily put exe file into MMB - it will become a part of the player: for example flash movie with flash projector player, your installer, notepad with text, another independent MMB project etc...
See example binding.mbd included in MMB samples, shows notepad and regedit inside page. Tested on Win2000 and Win 98SE

Note: Not all exe files can be binded, but many could (for example you can even bind CompactDraw or PhotoBrush....) Some exe files may be unhappy to be binded and may freeze your system - save often. Some exe files can't be binded at all or shows garbage (Winamp). You can't call just the file to open associated exe yet. You need to specify the executable and then the parameter (file). You can hide Menu, status bar or toolbars from the binded applications.
Binding objects has many advantages - you don't need to create a special version of your exe file, no ActiveX, no DLL..
You can have many BO on one page, you can have some even in Master Top Layer...

Communication Between MMB and Binding Object

MMB can send Menu Commands to the binded Object. Menu Command is the index of Menu as it appears on the original software. The Menu Index is zero Based.

SendComand("Binder","1,7")

Example: Binding notepad.exe

You need to count the menu separators as well.
In case of Nested Submenus, you can use the third optional parameter C

Sending String to Binding Object

To send string to the object (here Notepad), we can use MMB command - Clipboard.
First, we send the string to the clipboard, and then we invoke Select All and after that Paste command in the Binding Object. Click the Send Text button.
See the script below:

C$ = 'Hello from MMB!'
Clipboard("SEND","C$")
**select all
SendCommand("Binder","1,7")
** Paste
SendCommand("Binder","1.4")

With the same idea, we can get string from the object.
First, we invoke Select All, and then Copy and then we get the string from clipboard.

**select all
SendCommand("Binder","1,7")
** Copy
SendCommand("Binder","1,3")
Clipboard("GET","C$")
**display it
LoadText("TextDisp","C$")

(Un-Bind) the program.
- Terminate Process-default (brute force method which doesn't give the program chance to do anything about it)
- Send Close and wait. This is softer method and it gives the application a chance to do closing stuff (for example ask if you want to save changes etc...) Also, if application doesn't like the first method, try this one.

Un-Bind on Page Exit option (default). If checked the Binding exe file will be terminated if user goes into other page. That means any time you go to the page with binding object the exe will start again. This is probably great for applications as Flash animations etc... you don't want them to run if you are in other pages.

Hide Menu - Hides the menu of the binded application. If the app has nonstandard menu size or you need to hide larger height, use advanced options.

Hide Sizing Grip - Some application have Sizing Grip (like for example notepad.exe). You can mask it with this option so user won't be able to resize the binded application.

Advanced Properties
Help To locate window:

Some complex application may have many "Parent" windows - MMB may not always choose the right window so you have additional options which window of the binded application to bind in MMB. You can specify which string the main caption must have and which it must not have. If empty - then it doesn't apply.

Client main window Caption must have string
Client main window Caption must NOT have string
...

Note: In simple application (like notepad, Flash player etc. you don't have to worry about this. You should use this only if MMB choose wrong window from the application to bind.

Wait Before Binding - some applications may take longer time to start and MMB may not catch the window (it try to find the window too early, but the application does something else at this moment and don't yet have window created) This will tell MMB to wait before binding.

Additional Cut from Top or bottom - you can simply Crop the binded application from top or bottom. Great in cases when you need to hide toolbar or statusbar for example.